Optimal. Leaf size=51 \[ -\frac{\sin ^2\left (a+\frac{b}{x}\right )}{4 b^2}+\frac{\sin \left (a+\frac{b}{x}\right ) \cos \left (a+\frac{b}{x}\right )}{2 b x}-\frac{1}{4 x^2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.039533, antiderivative size = 51, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 14, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.214, Rules used = {3379, 3310, 30} \[ -\frac{\sin ^2\left (a+\frac{b}{x}\right )}{4 b^2}+\frac{\sin \left (a+\frac{b}{x}\right ) \cos \left (a+\frac{b}{x}\right )}{2 b x}-\frac{1}{4 x^2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3379
Rule 3310
Rule 30
Rubi steps
\begin{align*} \int \frac{\sin ^2\left (a+\frac{b}{x}\right )}{x^3} \, dx &=-\operatorname{Subst}\left (\int x \sin ^2(a+b x) \, dx,x,\frac{1}{x}\right )\\ &=\frac{\cos \left (a+\frac{b}{x}\right ) \sin \left (a+\frac{b}{x}\right )}{2 b x}-\frac{\sin ^2\left (a+\frac{b}{x}\right )}{4 b^2}-\frac{1}{2} \operatorname{Subst}\left (\int x \, dx,x,\frac{1}{x}\right )\\ &=-\frac{1}{4 x^2}+\frac{\cos \left (a+\frac{b}{x}\right ) \sin \left (a+\frac{b}{x}\right )}{2 b x}-\frac{\sin ^2\left (a+\frac{b}{x}\right )}{4 b^2}\\ \end{align*}
Mathematica [A] time = 0.0793681, size = 43, normalized size = 0.84 \[ \frac{x^2 \cos \left (2 \left (a+\frac{b}{x}\right )\right )-2 b \left (b-x \sin \left (2 \left (a+\frac{b}{x}\right )\right )\right )}{8 b^2 x^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.011, size = 97, normalized size = 1.9 \begin{align*} -{\frac{1}{{b}^{2}} \left ( \left ( a+{\frac{b}{x}} \right ) \left ( -{\frac{1}{2}\cos \left ( a+{\frac{b}{x}} \right ) \sin \left ( a+{\frac{b}{x}} \right ) }+{\frac{a}{2}}+{\frac{b}{2\,x}} \right ) -{\frac{1}{4} \left ( a+{\frac{b}{x}} \right ) ^{2}}+{\frac{1}{4} \left ( \sin \left ( a+{\frac{b}{x}} \right ) \right ) ^{2}}-a \left ( -{\frac{1}{2}\cos \left ( a+{\frac{b}{x}} \right ) \sin \left ( a+{\frac{b}{x}} \right ) }+{\frac{a}{2}}+{\frac{b}{2\,x}} \right ) \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [C] time = 1.12844, size = 92, normalized size = 1.8 \begin{align*} \frac{{\left ({\left (\Gamma \left (2, \frac{2 i \, b}{x}\right ) + \Gamma \left (2, -\frac{2 i \, b}{x}\right )\right )} \cos \left (2 \, a\right ) -{\left (i \, \Gamma \left (2, \frac{2 i \, b}{x}\right ) - i \, \Gamma \left (2, -\frac{2 i \, b}{x}\right )\right )} \sin \left (2 \, a\right )\right )} x^{2} - 4 \, b^{2}}{16 \, b^{2} x^{2}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.32934, size = 132, normalized size = 2.59 \begin{align*} \frac{2 \, x^{2} \cos \left (\frac{a x + b}{x}\right )^{2} + 4 \, b x \cos \left (\frac{a x + b}{x}\right ) \sin \left (\frac{a x + b}{x}\right ) - 2 \, b^{2} - x^{2}}{8 \, b^{2} x^{2}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 6.38814, size = 445, normalized size = 8.73 \begin{align*} \begin{cases} - \frac{b^{2} \tan ^{4}{\left (\frac{a}{2} + \frac{b}{2 x} \right )}}{4 b^{2} x^{2} \tan ^{4}{\left (\frac{a}{2} + \frac{b}{2 x} \right )} + 8 b^{2} x^{2} \tan ^{2}{\left (\frac{a}{2} + \frac{b}{2 x} \right )} + 4 b^{2} x^{2}} - \frac{2 b^{2} \tan ^{2}{\left (\frac{a}{2} + \frac{b}{2 x} \right )}}{4 b^{2} x^{2} \tan ^{4}{\left (\frac{a}{2} + \frac{b}{2 x} \right )} + 8 b^{2} x^{2} \tan ^{2}{\left (\frac{a}{2} + \frac{b}{2 x} \right )} + 4 b^{2} x^{2}} - \frac{b^{2}}{4 b^{2} x^{2} \tan ^{4}{\left (\frac{a}{2} + \frac{b}{2 x} \right )} + 8 b^{2} x^{2} \tan ^{2}{\left (\frac{a}{2} + \frac{b}{2 x} \right )} + 4 b^{2} x^{2}} - \frac{4 b x \tan ^{3}{\left (\frac{a}{2} + \frac{b}{2 x} \right )}}{4 b^{2} x^{2} \tan ^{4}{\left (\frac{a}{2} + \frac{b}{2 x} \right )} + 8 b^{2} x^{2} \tan ^{2}{\left (\frac{a}{2} + \frac{b}{2 x} \right )} + 4 b^{2} x^{2}} + \frac{4 b x \tan{\left (\frac{a}{2} + \frac{b}{2 x} \right )}}{4 b^{2} x^{2} \tan ^{4}{\left (\frac{a}{2} + \frac{b}{2 x} \right )} + 8 b^{2} x^{2} \tan ^{2}{\left (\frac{a}{2} + \frac{b}{2 x} \right )} + 4 b^{2} x^{2}} + \frac{2 x^{2} \tan ^{4}{\left (\frac{a}{2} + \frac{b}{2 x} \right )}}{4 b^{2} x^{2} \tan ^{4}{\left (\frac{a}{2} + \frac{b}{2 x} \right )} + 8 b^{2} x^{2} \tan ^{2}{\left (\frac{a}{2} + \frac{b}{2 x} \right )} + 4 b^{2} x^{2}} + \frac{2 x^{2}}{4 b^{2} x^{2} \tan ^{4}{\left (\frac{a}{2} + \frac{b}{2 x} \right )} + 8 b^{2} x^{2} \tan ^{2}{\left (\frac{a}{2} + \frac{b}{2 x} \right )} + 4 b^{2} x^{2}} & \text{for}\: b \neq 0 \\- \frac{\sin ^{2}{\left (a \right )}}{2 x^{2}} & \text{otherwise} \end{cases} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\sin \left (a + \frac{b}{x}\right )^{2}}{x^{3}}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]